package com.canbot.u05.bean.guide;

import android.text.TextUtils;


import com.canbot.u05.socket.MsgSendUtils;
import com.canbot.u05.socket.MsgType;
import com.canbot.u05.utils.PathConst;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zmp on 2017/7/27.
 */

public class MapVoiceAndEyes {

        public static final String MAP_VOICE_DIR = PathConst.MAP_VOICE_DIR;

        public static final String PRESENTER_VOICE_DIR = "/ai/ai05res/a1/res/audio/presenterVoice/";

        public static final List<VoiceAndEyesInfo> voiceEyesList = new ArrayList<>();

        static {
                //导览 0-9
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "qrdt_dlms_u05_001.wav", "14"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "hdwrwts_dlms_u05_001.wav", "12"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "bzts_dlms_u05_001.wav", "18"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "rwdnr_dlms_u05_001.wav", "14", "14001"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "dzszts_dlms_u05_001.wav", "12"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "srwdwc_dlms_u05_001.wav", "32"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "bcrwts_dlms_u05_001.wav", "12"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "bcrwcg_dlms_u05_001.wav", "18"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "bcrwsb_dlms_u05_001.wav", "28"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "wdtts_dtgj_u05_001.wav", "1"));


                //自动充电 10 --17
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/hjqr_zdcd_u05_001.wav", "14"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/xzdt_zdcd_u05_001.wav", "18"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/cdzts_zdcd_u05_001.wav", "24"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/cddts_zdcd_u05_001.wav", "35"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/cddyd_zdcd_u05_001.wav", "12"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/bjcg_zdcd_u05_001.wav", "12"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/bjsb_zdcd_u05_001.wav", "28"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "/eatPower/kgsm_zdcd_u05_001.wav", "8"));


                //主持 18 --26
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "zcszdr_zcms_u05_001.wav", "26", "14001"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "rwnr_zcms_u05_001.wav", "38", "14009"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "wdmk_zcms_u05_001.wav", "29", "14007"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "yymk_zcms_u05_001.wav", "14", "14001"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "dzsz_zcms_u05_001.wav", "18", "14006"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "ydxz_zcms_u05_001.wav", "17", "14008"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "ydcs_zcms_u05_001.wav", "34", "14003"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "zxcs_zcms_u05_001.wav", "34", "14004"));
                voiceEyesList.add(new VoiceAndEyesInfo(PRESENTER_VOICE_DIR + "ydyy_zcms_u05_001.wav", "28", "14009"));

                /**
                 * 导览v4 27 - 31
                 */
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "yysz_dlms_u05_001.wav", "32", "14003"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "srwdwc_dlms_u05_001.wav", "32", "14006"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "dzsz_dlms_u05_001.wav", "12", "14004"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "tpsz_dlms_u05_001.wav", "30", "14009"));
                voiceEyesList.add(new VoiceAndEyesInfo(MAP_VOICE_DIR + "gzgw_dlms_u05_001.wav", "18", "14010"));

        }

        public static final VoiceAndEyesInfo[] CODE_MARKETING =
                {
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewxz_001.mp3", null, "14006"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewxz_002.mp3", null, "14007"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewtp_001.mp3", null, "14009"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewtp_002.mp3", null, "14001"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewyy_001.mp3", null, "14001"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewyy_002.mp3", null, "14001"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewjg_001.mp3", null, "14006"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewjg_002.mp3", null, "14008"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewmb_001.mp3", null, "14006"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewmb_002.mp3", null, "14008"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewdr_001.mp3", null, "14009"),
                        new VoiceAndEyesInfo(PathConst.CODE_MARKETING_DIR + "u05_ewdr_002.mp3", null, "14009"),
                        };

        public static class VoiceAndEyesInfo {

                String path;

                String eyesID;

                String actionID;

                public VoiceAndEyesInfo(String path, String eyesID, String actionID) {
                        this.path = path;
                        this.eyesID = eyesID;
                        this.actionID = actionID;
                }

                public VoiceAndEyesInfo(String path, String eyesID) {
                        this.path = path;
                        this.eyesID = eyesID;
                }

                public String getPath() {
                        return path;
                }

                public void setPath(String path) {
                        this.path = path;
                }

                public String getEyesID() {
                        return eyesID;
                }

                public void setEyesID(String eyesID) {
                        this.eyesID = eyesID;
                }

                public String getActionID() {
                        return actionID;
                }

                public void setActionID(String actionID) {
                        this.actionID = actionID;
                }

                @Override
                public String toString() {
                        return "VoiceAndEyesInfo{" + "path='" + path + '\'' + ", eyesID='" + eyesID + '\'' + ", actionID='" + actionID + '\'' + '}';
                }

                public void playMapVoiceAndEyes() {
                        if (!TextUtils.isEmpty(path)) {
                                MsgSendUtils.sendStringMsg(MsgType.PLAY_SOUND, path);

                        }
                        if (!TextUtils.isEmpty(eyesID)) {
                                MsgSendUtils.sendStringMsg(MsgType.EYE_MOTION, eyesID);

                        }
                        if (!TextUtils.isEmpty(actionID)) {
                                MsgSendUtils.sendStringMsg(MsgType.ACTION, actionID);

                        }
                }
        }

        /**
         * 播放导览任务提示音频
         *
         * @param info
         */
        public static void playMapVoiceAndEyes(VoiceAndEyesInfo info) {
                String path = info.getPath();
                String eyesID = info.getEyesID();
                String actionID = info.getActionID();
                if (!TextUtils.isEmpty(path)) {
                        MsgSendUtils.sendStringMsg(MsgType.PLAY_SOUND, path);

                }
                if (!TextUtils.isEmpty(eyesID)) {
                        MsgSendUtils.sendStringMsg(MsgType.EYE_MOTION, eyesID);

                }
                if (!TextUtils.isEmpty(actionID)) {
                        MsgSendUtils.sendStringMsg(MsgType.ACTION, actionID);

                }
        }

        public static void stop(){
                MsgSendUtils.sendStringMsg(MsgType.STOP_SOUND, "stop_sound");
                MsgSendUtils.sendStringMsg(MsgType.STOP_ACTION, "stop_sound");
        }
}

